#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include <QtXml>
#include "mainapplication.h"
#include "webview.h"

namespace Ui {
    class MainWidget;
}

class MainWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MainWidget(QWidget *parent, MainApplication *app);
    ~MainWidget();
private:
    Ui::MainWidget *ui;
protected:
    MainApplication *f_app;
    WebView *f_web_view;
protected:
    bool setXmlContent(QDomDocument &domDocument, QByteArray &rawXml);
    QString getVideoTitle(QString a_id);
    QString getSaveFileName(QString a_title, QString a_id, int a_fmt, QString a_type);
public slots:
    void submitIdToDownload(QString a_id, int a_fmt, QString a_type = "");
private slots:
    void on_pushButton_clicked();
    void populateJavaScriptWindowObject();
};

#endif // MAINWIDGET_H
